<template>
    <div>
        <el-card shadow="hover" class="card-main">
            <el-input v-model="state.resulst.param_value" :rows="20" type="textarea" placeholder="Please input" />
            <div>
                <el-button type="primary" @click="save">保存</el-button>
            </div>
        </el-card>
    </div>
</template>
<script setup>
import { reactive, getCurrentInstance } from 'vue'
import { ElMessage } from 'element-plus'
const { proxy } = getCurrentInstance();
const state = reactive({
    resulst: {
        textarea: ''
    },

})

const getData = async () => {
    let res = await proxy.$api.home.getCompanyInfo()
    state.resulst = res.result
    console.log('res', res);
}
getData()
const save = () => {
        console.log('state.resulst', state.resulst);
    let params = {
        paramKey: state.resulst.param_key,
        id: state.resulst.id,
        paramValue: state.resulst.param_value,
        remark: state.resulst.remark,
        status: state.resulst.status,
    }
    proxy.$api.home.configUpdate(params).then(res => {
        console.log('res', res);
        console.log('res', res);
        if (res.msg === "success") {
            getData()
            ElMessage({
                type: 'success',
                message: '修改成功',
            })
        }
        getData()
    })
}
</script>
<style scoped lang="scss">
.card-main {
    margin-top: 20px;
    height: calc(100vh - 200px);
    position: relative;

    .pagination {
        margin-top: 10px;
        display: flex;
        justify-content: flex-end;
        text-align: right;
    }
}
</style>